{extend name='public/base' /}
{block name='content'}
{include file='public/content_header' /}
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="box box-primary">
                <!-- 表单头部 -->
                <div class="box-header with-border">
                    <div class="btn-group">
                        <a class="btn flat btn-sm btn-default BackButton">
                            <i class="fa fa-arrow-left"></i>
                            返回
                        </a>
                    </div>
                </div>
                <!-- 表单 -->
                <form id="dataForm" class="form-horizontal dataForm" action="" method="post"
                      enctype="multipart/form-data">
                    <!-- 表单字段区域 -->
                    <div class="box-body">

                        <div class="form-group">
                            <label for="ota_name" class="col-sm-2 control-label">设备号</label>
                            <div class="col-sm-10 col-md-4">
                                <input id="ota_name" name="ota_name" value="{$data.ota_name|default=''}"
                                       placeholder="请输入设备号" type="text" readonly class="form-control field-text">
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="name" class="col-sm-2 control-label">分组名称</label>
                            <div class="col-sm-10 col-md-4">
                                <input id="name" name="name" value="{$group.group_name|default=''}"
                                       placeholder="请输入分组名称" type="text" readonly class="form-control field-text">
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="config_hezhou" class="col-sm-2 control-label">参数配置_合宙</label>
                            <div class="col-sm-10 col-md-4">
                                <textarea name="config_hezhou" class="form-control field-text" id="config_hezhou"
                                          cols="30" rows="10" readonly>{$group.config_hezhou|default=''}</textarea>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label"></label>
                            <div class="col-sm-10 col-md-4">
                                <div class="alert alert-danger" role="alert">
                                    *API请求地址：{:request()->domain()}/api/dtu/{$data.ota_name}<br/>
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="config_custom" class="col-sm-2 control-label">参数配置_自定义</label>
                            <div class="col-sm-10 col-md-4">
                                <textarea name="config_custom" class="form-control field-text" id="config_custom"
                                          cols="30" rows="10" readonly>{$group.config_custom|default=''}</textarea>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label"></label>
                            <div class="col-sm-10 col-md-4">
                                <div class="alert alert-danger" role="alert">
                                    *API请求地址：{:request()->domain()}/api/custom/{$data.ota_name}<br/>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</section>
<script>
    /** 表单验证 **/
    $('#dataForm').validate({
        rules: {
            'group_name': {
                required: true,
            },

        },
        messages: {
            'account': {
                required: "分组名称不能为空",
            },

        }
    });
</script>
{/block}